import React from 'react';
import { Menu, Dropdown, Icon } from 'antd';


class UserInfo extends React.Component{
  constructor(props){
    super(props);

    this.state = {
      menus: [
        {
          href: "javascript:;",
          label: "修改密码"
        },
        {
          href: "javascript:;",
          label: "帮助中心"
        },
        {
          href: "javascript:;",
          label: "意见反馈"
        }
      ]
    }
  }
  render() {
    let list = [];
    if(this.state.menus.length > 0) {
      this.state.menus.map(function(item, index){
        list.push(
          <Menu.Item key={index}>
            <a href={item.href}>{item.label}</a>
          </Menu.Item>
        )
      })
    }
    const menu = (<Menu>{list}</Menu>);
    return (
      <div className="userinfo">        
        <Dropdown overlay={menu} trigger={['click']}>
          <div className="headimg">
            明
          </div>
        </Dropdown>
      </div>
    );
  }
}; 

export default UserInfo;


